package sqlx

import "time"

type options struct {
	MaxIdleConn int
	MaxOpenConn int
	MaxLifetime time.Duration
}

type Option func(o *options)

func MaxIdleConn(maxIdleConn int) Option {
	return func(o *options) {
		o.MaxIdleConn = maxIdleConn
	}
}

func MaxOpenConn(maxOpenConn int) Option {
	return func(o *options) {
		o.MaxOpenConn = maxOpenConn
	}
}

func newDefaultOptions() *options {
	return &options{
		MaxIdleConn: 64,
		MaxOpenConn: 64,
		MaxLifetime: time.Minute,
	}
}
